package com.itheima.d2_buffered_stream;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintStream;

/**
 * 目标：掌握字符缓冲输入流的用法。
 */
public class Test2BufferedReader {
    public static void main(String[] args) throws FileNotFoundException {
        FileReader fr = new FileReader("day10io-app2/file/出师表.txt");
        reader(fr);
    }

    public static void reader(FileReader fr) {
        long l1 = System.currentTimeMillis();
        try (BufferedReader br = new BufferedReader(fr);) {
            String str;
            while ((str = br.readLine()) != null) {
                System.out.println(str);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        long l2 = System.currentTimeMillis();
        System.out.println((l2-l1)/1000.0);
    }
}
